/*
 * Copyright (C) 2025 Holaf
 * Holaf Utilities - Toast Notification Styles
 *
 * Provides styling for the non-blocking toast notification system.
 * Supports different types (success, error, info) and progress bars.
 */

#holaf-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 12000; /* High z-index to be on top of most UI, but below critical modals */
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
    width: 100%;
}

.holaf-toast {
    background-color: var(--holaf-background-secondary);
    color: var(--holaf-text-primary);
    border-radius: 6px;
    box-shadow: var(--holaf-box-shadow);
    border: 1px solid var(--holaf-border-color);
    border-left: 5px solid var(--holaf-accent-color); /* Default accent */
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transform: translateX(100%);
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
    animation: holaf-toast-slide-in 0.4s ease-in-out forwards;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

@keyframes holaf-toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.holaf-toast.holaf-toast-fade-out {
    animation: holaf-toast-slide-out 0.4s ease-in-out forwards;
}

@keyframes holaf-toast-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
        margin-top: -10px; /* Animate height collapse */
        padding-top: 0;
        padding-bottom: 0;
        height: 0;
        border-width: 0;
    }
}

.holaf-toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.holaf-toast-message {
    flex-grow: 1;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

/* Toast Types */
.holaf-toast.success {
    border-left-color: var(--holaf-success-color, #4caf50);
}
.holaf-toast.success .holaf-toast-icon {
    color: var(--holaf-success-color, #4caf50);
}

.holaf-toast.error {
    border-left-color: var(--holaf-error-color, #f44336);
}
.holaf-toast.error .holaf-toast-icon {
    color: var(--holaf-error-color, #f44336);
}

.holaf-toast.info {
    border-left-color: var(--holaf-accent-color, #2196f3);
}
.holaf-toast.info .holaf-toast-icon {
    color: var(--holaf-accent-color, #2196f3);
}

/* Progress Bar for persistent toasts */
.holaf-toast-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background-color: var(--holaf-accent-color);
    width: 0%; /* Initial width */
    transition: width 0.2s linear;
}

.holaf-toast.success .holaf-toast-progress-bar {
    background-color: var(--holaf-success-color, #4caf50);
}

.holaf-toast.error .holaf-toast-progress-bar {
    background-color: var(--holaf-error-color, #f44336);
}

/* Close button on hover */
.holaf-toast-close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border: none;
    background-color: transparent;
    color: var(--holaf-text-secondary);
    font-size: 16px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    border-radius: 50%;
    opacity: 0.6;
    transition: opacity 0.2s, background-color 0.2s;
}

.holaf-toast-close-btn:hover {
    opacity: 1;
    background-color: var(--holaf-border-color);
}